<template>
  <div>
    <div>子组件：{{ txt }}</div>
    <grandson></grandson>
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue"
import grandson from './grandson.vue'
import eventBus from "../utils/event-bus";
let txt = ref('children')
onMounted(() => {
  eventBus.on('whyEvent', (args) => {
    console.log('children组件监听：', args)
    txt.value = args
  })
})
</script>

<style lang="scss" scoped></style>